/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package es.unavarra.mti.iws.logic.undoredo;

import es.unavarra.mti.iws.logic.editor.Selectable;
import es.unavarra.mti.iws.model.Model;

/**
 *
 * @author Asier
 */
public class AddEntry implements UndoRedoOperation{
    private final Model container;
    private Selectable entry;

    public AddEntry(Model model, Selectable entry) {
        this.container = model;
        this.entry = entry;
    }

    public void redo() {
        synchronized (container) {
            container.add(entry);
        }
    }

    public void undo() {
        synchronized (container) {
            container.remove(entry);
        }
    }

}
